(module
 (memory $appMemory 0)
 (memory $dataMemory 2)
 (memory $instrumentMemory 4)
  (func (export "size") (result i32) (memory.size))
  (func (export "grow") (param $sz i32) (drop (memory.grow (local.get $sz))))
  (func (export "size1") (result i32) (memory.size 1))
  (func (export "grow1") (param $sz i32) (drop (memory.grow 1 (local.get $sz))))
  (func (export "size2") (result i32) (memory.size 2))
  (func (export "grow2") (param $sz i32) (drop (memory.grow 2 (local.get $sz))))
)

(assert_return (invoke "size") (i32.const 0))
(assert_return (invoke "grow" (i32.const 1)))
(assert_return (invoke "size") (i32.const 1))
(assert_return (invoke "grow" (i32.const 4)))
(assert_return (invoke "size") (i32.const 5))
(assert_return (invoke "grow" (i32.const 0)))
(assert_return (invoke "size") (i32.const 5))

(assert_return (invoke "size1") (i32.const 2))
(assert_return (invoke "grow1" (i32.const 2)))
(assert_return (invoke "size1") (i32.const 4))
(assert_return (invoke "grow1" (i32.const 4)))
(assert_return (invoke "size1") (i32.const 8))
(assert_return (invoke "grow1" (i32.const 0)))
(assert_return (invoke "size1") (i32.const 8))

(assert_return (invoke "size2") (i32.const 4))
(assert_return (invoke "grow2" (i32.const 4)))
(assert_return (invoke "size2") (i32.const 8))
(assert_return (invoke "grow2" (i32.const 8)))
(assert_return (invoke "size2") (i32.const 16))
(assert_return (invoke "grow2" (i32.const 0)))
(assert_return (invoke "size2") (i32.const 16))
